﻿using System;
using System.ComponentModel;
using System.Xml.Linq;

namespace uottawatourguide
{
    public class TourViewModel : INotifyPropertyChanged
    {
        private string thumbnailuri;
        public string ThumbNailURI
        {
            get
            {
                return thumbnailuri;
            }
            set
            {
                if (value != thumbnailuri)
                {
                    thumbnailuri = value;
                    NotifyPropertyChanged("ThumbNailURI");
                }
            }
        }
        private string title;
        public string Title
        {
            get
            {
                return title;
            }
            set
            {
                if (value != title)
                {
                    title = value;
                    NotifyPropertyChanged("Title");
                }
            }
        }

        private string description;
        public string Description
        {
            get
            {
                return description;
            }
            set
            {
                if (value != description)
                {
                    description = value;
                    NotifyPropertyChanged("Description");
                }
            }
        }

        private XElement stops;
        public XElement Stops
        {
            get
            {
                return stops;
            }
            set
            {
                if (value != stops)
                {
                    stops = value;
                    NotifyPropertyChanged("Stops");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
